package a;

public class Fa {
    public String pubName;
    protected String proName;
    String defName;
    private String priName;
    public Fa(){
        this.pubName = "public";
        this.proName = "protected";
        this.defName = "default";
        this.priName = "private";
    }
    public void pubMethod(){
        System.out.println("这是public方法");
    }
    public void proMethod(){
        System.out.println("这是protected方法");
    }
    public void defMethod(){
        System.out.println("这是default方法");
    }
    public void priMethod(){
        System.out.println("这是private方法");
    }

    void test(){
        System.out.println(this.pubName);
        System.out.println(this.proName);
        System.out.println(this.defName);
        System.out.println(this.priName);
        this.pubMethod();
        this.proMethod();
        this.defMethod();
        this.priMethod();
    }
}
